package com.demo.reduction;

import com.demo.common.Dish;
import com.demo.common.DishUtil;

import java.util.List;

import static java.util.stream.Collectors.joining;

public class TestJoining {
    public static void main(String[] args) {
        List<Dish> menu = DishUtil.getDishes();
        String shortMenu = menu.stream().map(Dish::getName).collect(joining(", "));
        System.out.println(shortMenu);
    }
}
